<%@ page import="org.subject.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入 jstl--%>
<%@include file="common/tag.jsp" %>
<html>
<head>
    <title>个人中心</title>
    <%@include file="common/head.jsp" %>
    <link href="/./resource/css/all.css"/>
    <script src="/./resource/js/list.js"></script>
    <style>
        .persontop {
            margin-top: 20px;
        }

        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
        }

        #container {
            min-height: 100%;
            height: auto !important;
            height: 100%; /*IE6不识别min-height*/
            position: relative;
        }

        #page {
            width: 100%;
            margin-bottom: 50px; /*等于footer的高度*/
        }
    </style>
    <%
        User user = (User) session.getAttribute("user");
    %>
</head>
<body background="/./resource/images/bg.jpg" style="background-size: cover;background-repeat: no-repeat;">
<div id="container" class="container persontop">
    <ul class="nav nav-tabs" role="tablist" id="tab-list">
        <li><a href="/user/detail?userId=<%=user.getUserId()%>" role="tab">个人信息</a></li>
        <li class="active"><a href="#lijiang" role="tab">编辑个人信息</a></li>
        <c:choose>
            <c:when test="${user.getUserRole() == 2}">
                <li><a href="/message/publish?userId=<%=user.getUserId()%>" role="tab">发布竞赛</a></li>
            </c:when>
        </c:choose>
        <li><a href="#shuiliandong" role="tab">竞赛历史</a></li>
        <c:choose>
            <c:when test="${user.getUserRole() == 1}">
                <li><a href="#shuiliandong" role="tab">管理竞赛</a></li>
            </c:when>
        </c:choose>
    </ul>

    <div class="row">
        <div class="col-lg-11" style="border:0px solid #000;margin-top: 10px;">
            <form:form action="/user/modify" method="post" class="form-horizontal" style="margin-top: 40px;"
                       commandName="user">
                <div class="form-group">
                    <label class="col-lg-1 control-label">学号</label>
                    <div class="col-lg-11 control-label">
                            ${user.userNumber}
                    </div>
                </div>
                <div class="form-group">
                    <form:label for="password" class="col-lg-1 control-label" path="userPassword">新密码</form:label>
                    <div class="col-lg-11 control-label">
                        <form:input id="password" class="form-control" type="password" name="personName"
                                    path="userPassword"/>
                    </div>
                </div>
                <div class="form-group">
                    <form:label for="rePassword" class="col-lg-1 control-label" path="userPassword">重复密码</form:label>
                    <div class="col-lg-11 control-label">
                        <form:input path="userPassword" id="rePassword" class="form-control" type="password"
                                    name="personName"/>
                    </div>
                </div>
                <div class="form-group">
                    <form:label for="personName" class="col-lg-1 control-label" path="userName">姓名</form:label>
                    <div class="col-lg-11 control-label">
                        <form:input path="userName" id="personName" class="form-control" type="text"
                                    value="${user.userName}" name="personName"/>
                    </div>
                </div>
                <div class="form-group">
                    <form:label for="personSystem" class="col-lg-1 control-label" path="userRemark">学院</form:label>
                    <div class="col-lg-11">
                        <form:select class="form-control" path="userRemark">
                            <%--<option value="none" label="请选择..."/>
                            <options items="${facultyList}"/>--%>
                            <%--<c:forEach items="${facultyList}"--%>
                            <form:option value="none" label="请选择..."></form:option>
                            <form:options items="${facultyList}"></form:options>
                        </form:select>
                    </div>
                </div>
                <div class="form-group">
                    <form:label for="userProfession" class="col-lg-1 control-label"
                                path="userProfession">专业</form:label>
                    <div class="col-lg-11">
                        <form:input path="userProfession" id="userProfession" class="form-control" type="text"
                                    value="${user.userProfession}" name="personNumber"/>
                    </div>
                </div>
                <div class="form-group">
                    <form:label for="userClass" class="col-lg-1 control-label" path="userClass">班级</form:label>
                    <div class="col-lg-11">
                        <form:input path="userClass" id="userClass" class="form-control" type="text"
                                    value="${user.userClass}" name="personNumber"/>
                    </div>
                </div>
                <div class="form-group">
                    <form:label for="personPhone" class="col-lg-1 control-label" path="userPhone">电话号码</form:label>
                    <div class="col-lg-11">
                        <form:input path="userPhone" id="personPhone" class="form-control" type="text"
                                    value="${user.userPhone}" name="personNumber"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="row">
                        <div class="col-lg-1 col-lg-offset-1">
                            <input id="publish" onclick="clicke()" class="btn" type="submit" style="margin-left: 10px"
                                   value="提交"/>
                        </div>
                        <div class="col-lg-1 col-lg-offset-0">
                            <input class="btn" type="reset" value="重新填写"/>
                        </div>
                    </div>
                </div>

            </form:form>
        </div>
    </div>
</body>

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>